import time
import requests

SERVER_URL = "http://???"

def send_print_request(computer_id, content):
    """发送打印请求到服务器"""
    payload = {
        'computer_id': computer_id,
        'content': content,
        'timestamp': int(time.time())
    }
    try:
        response = requests.post(f"{SERVER_URL}/send_print_task", json=payload)
        if response.json().get('status') == 'success':
            print("Print request sent successfully")
        else:
            print("Failed to send print request")
    except Exception as e:
        print(f"Error sending request: {e}")

# 示例使用
if __name__ == '__main__':
    send_print_request(
        "test-computer-id",
        {"skuOuterId": ""}
    )